package com.ruicar.afs.cloud.image.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruicar.afs.cloud.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description:
 * @Author: fangchenliang
 * @Date: 2020/5/15 20:07
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("com_attachment_management")
@ApiModel(value = "影像")
public class ComAttachmentManagement extends BaseEntity<ComAttachmentManagement> {
    /**
     * 附件名称
     */
    private String attachmentName;
    /**
     * 层级;大类、组、小类
     */
    private int attachmentClass;
    /**
     * 包含项目数
     */
    private int itemNum;
    /**
     * 文件最大数
     */
    private int maxFileNums;
    /**
     * 文件最小数
     */
    private int minFileNums;
    /**
     * 必传类型;必传、规则匹配
     */
    private String needType;

    /**附件小类唯一编码*/
    private String uniqueCode;

    /**归档类型（数据字典与归档系统保持一致）*/
    private String archiveClass;

    /**
     * 父级
     */
    @ApiModelProperty(value = "父id")
    @JsonSerialize(using = ToStringSerializer.class)
    @JSONField(serializeUsing = com.alibaba.fastjson.serializer.ToStringSerializer.class)
    private Long parentId;
    /**
     * 业务节点
     */
    private String busiNode;
    /**
     * 生效日期起
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effectiveDateStart;
    /**
     * 生效日期止
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effectiveDateEnd;
    /**
     * 是否归档
     */
    private String isArchive;
    /**
     * 规则编号
     */
    private String ruleId;
    /**
     * 是否启用规则
     */
    private String isEnableRule;

    @ApiModelProperty(value = "排序值")
    private BigDecimal sortOrder;

    @TableField(exist = false)
    @ApiModelProperty(value = "子节点")
    private List<ComAttachmentManagement> children;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否选中 前端所需")
    private Boolean selected = false;

    @TableField(exist = false)
    @ApiModelProperty(value = "节点展开 前端所需")
    private Boolean expand = true;

    @TableField(exist = false)
    @ApiModelProperty(value = "规则解析返回值-影像件项目数：0 表示只显示，大于1必传标注星号")
    private int needNums;

    @TableField(exist = false)
    @ApiModelProperty(value = "规则解析返回描述")
    private String desc;

    @TableField(exist = false)
    @ApiModelProperty(value = "是否命中规则")
    private boolean hit;

    /**
     * 文件列表
     */
    @TableField(exist = false)
    private List<ComAttachmentFile> fileList;
    /**
     * 业务编号
     */
    @TableField(exist = false)
    private String busiNo;
    /**
     * 审核是否通过
     */
    @TableField(exist = false)
    private boolean qualified;

    @TableField(exist = false)
    private String authorization;

    /**
     * 同步状态
     */
    private String synchronizationState;

    @TableField(exist = false)
    @ApiModelProperty(value = "影像状态合格-true-false")
    private Boolean attachmentStatus ;

    /**
     * 有效文件数量
     */
    @TableField(exist = false)
    private Integer validNums = 0;

}
